package com.movie.service.Impl;

import com.movie.beans.Movie;
import com.movie.beans.Movies;
import com.movie.beans.Recommend;
import com.movie.dao.MovieDAO;
import com.movie.service.MovieService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MovieServiceImpl implements MovieService {
    @Resource
    private MovieDAO movieDAO;

    @Override
    public List<Movie> getDefaultMovieList() {
        return movieDAO.selectMovieList();
    }

    @Override
    public List<Movies> MoviesList() {
        return movieDAO.selectMoviesList();
    }

    @Override
    public List<Movies> MoviesList(String val) {
        return movieDAO.selectSearchMoviesList(val);
    }

    @Override
    public List<Movies> getDefaultMovies() {
        return null;
    }

    @Override
    public Movies getMoviesById(Long movieId) {
        return movieDAO.getMoviesById(movieId);
    }

    @Override
    public Recommend selectRecommend(Long userId) {
        return movieDAO.selectRecommend(userId);
    }

    @Override
    public List<Movies> getMoviesBySearchVal(String searchVal) {
        return movieDAO.getMoviesBySearchVal(searchVal);
    }

    @Override
    public List<Movies> selectNewest10List() {
        return movieDAO.selectNewest10List();
    }

    @Override
    public List<Movies> selectTop10RateList() {
        return movieDAO.selectTop10RateList();
    }

    @Override
    public int insertMovies(Movies movies) {
        return movieDAO.insertMovies(movies);
    }

    @Override
    public int deleteMoviesById(Movies movies) {
        return movieDAO.deleteMoviesById(movies);
    }
}
